<div class="row">
    	<div class="col-xs-12">

    		<div class="ui-portlet">
				<ol class="breadcrumb">
				  <li><a href="/users/index"><i class="fa fa-home"></i>&nbsp;&nbsp;个人中心</a></li>
				  <li><a href="/bots/mine">我的机器人</a></li>
				  <li class="active">{{$Bot['Bot']['name']}}</li>
				</ol>
			</div>

      		<a class="btn btn-primary" href="/bot_groups/add?bot_id={{$Bot['Bot']['id']}}">创建新群</a>
			<hr>
		</div>

{{$this->Form->create('Bot',array('url'=>array('action'=>'sendGroupMsg'),'class'=>'form-horizontal','id'=>'BotViewForm','role'=>'form'))}}
		<div class="col-md-12">
			<p>
				<label><input type="checkbox" onclick="checkAll(this,'#BotViewForm');"> 全选</label>
			</p>
			<portlet cache="no" limit="200" portlet="body" model="BotGroup" list_tpl="inner" conditions="bot_id=$id">
				<div style="display:inline-block;margin:0 5px 5px 0;padding:10px;border:1px solid #eee;"><label><input type="checkbox" name="group[]" value="{{$item['id']}}">{{$item['name']}} </label> 

					<p><a target="_blank" href="/bots/editgroup/{{$id}}/{{$item['id']}}">修改群信息</a></p>
					<p><small>
						<a target="_blank" href="/bot_groups/invite/{{$item['id']}}">邀请加入群分享</a>
					</small></p>
				</div>
			</portlet>
		</div>
		<div class="col-md-12">
			
				<div class="form-group">
					<label class="col-sm-2 control-label" for="BotMessageMessage">群发消息</label>
					<div class="col-sm-9 controls">
						<input type="hidden" name="bot_id" value="{{$id}}">
						<textarea name="content" class="form-control valid" rows="3" cols="30" aria-invalid="false"></textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"></label>
					<div class="col-sm-9"><input onclick="return confirm('是否确认群发消息内容');" class="btn btn-primary" type="submit" value="提交"></div>
				</div>
				<hr>

				
		</div>
{{$this->Form->end()}}
</div>


<portlet title="查询活动的发起用户编号">
<form >					
	<p><input class="form-control" id="query-activity-id" placeholder="输入活动编号"></p>
	<p><br></p>
	<div id="query-result"></div>
	<button class="btn btn-primary" onclick="return ajaxAction('/wx_activities/view/'+$('#query-activity-id').val()+'.json',null,null,function(request){$('#query-result').html('活动'+request.data.WxActivity.id+'的用户编号是 <strong>'+request.data.WxActivity.creator+'</strong><p><br></p>');});" >查询</button>
</form>	
</portlet>

